home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 1182 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.4 KB

  1. From: David Brownell <brownell@ix.netcom.com>
  2. Message-ID: <317958CE.2B89@ix.netcom.com>
  3. X-Original-Date: Sat, 20 Apr 1996 14:36:14 -0700
  4. Path: in1.uu.net!bounce-back
  5. Date: 21 Apr 96 07:00:00 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.programming.threads,comp.std.c++
  8. Subject: Re: Is STL MT-Safe?
  9. Organization: Dave's VAX
  10. References: <4kmjvj$89t@usc.edu> <4kspmb$9tb@ubszh.fh.zh.ubs.com> <3173E95E.5AC@ix.netcom.com> <4l12rf$q11@galaxy.ucr.edu> <31753C02.58A6@ix.netcom.com> <4l8pud$3t8@galaxy.ucr.edu>
  11. X-Netcom-Date: Sat Apr 20  4:37:13 PM CDT 1996
  12. X-Mailer: Mozilla 2.0 (Win95; I)
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBFAgUBMXndH+EDnX0m9pzZAQFTDAF/daqzUqq+Kx1H1BC50W9aRl8lpsIDJyoc
  15.     Fg0k8LZgET0RgTdk/3Bj1Ind+vOzQLGJ
  16.     =Pnv2
  17.  
  18. Tom Payne wrote:
  19. > The second major need is to allow a signal to force an exception in
  20. > without the program polling for it.
  21.  
  22. I guess we'll just disagree on this ... I see signals as basically
  23. asynchronous, and exceptions as wholly synchronous.  Plus, exactly
  24. which exceptions are legal will vary depending on the state of the
  25. thread's execution (i.e. the "throw" specification of the function
  26. being executed).  So it doesn't make sense to me to mix the two.
  27.  
  28. If you want signals to cause exceptions, it's simple enough to code
  29. the handoff between signal handling thread and the exception-raising
  30. one ... either sigwait() and pthread_cond_signal(), or else use the
  31. older asynchronous signal handlers and a semaphore.  The thread that
  32. blocked on the synchronization variable (sema_t or pthread_cond_t)
  33. raises whatever exception it wants.
  34.  
  35.  
  36. >     In a thread on this
  37. > topic a couple months ago, David Chase gave an implementation strategy
  38. > based on range tables that seemed to involve no CPU overhead and whose
  39. > complexity seemed reasonable.
  40.  
  41. But if the exceptions aren't synchronous, the complexity of generating
  42. those tables can become extremely high ... particularly in conjunction
  43. with the code motion performed as part of most optimizations.  As was
  44. pointed out to me by David himself.
  45. -- 
  46. David Brownell
  47. http://www.netcom.com/~brownell
  48. ---
  49. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  50. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  51. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  52. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  53. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  54.